package com.liaow.test.retrofit.api;

import org.springframework.stereotype.Component;

import com.github.lianjiatech.retrofit.spring.boot.annotation.RetrofitClient;
import com.liaow.test.retrofit.response.Result;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Query;

/**
 * @Description: HTTP Client 工具库
 * baseUrl 配置的远程接口服务请求路径
 * @Author: L.Wen
 * @Creation_Time: 2020/08/11 21:46
 */
@Component
@RetrofitClient(baseUrl = "${test.baseUrl}")
public interface HttpClientApi {

    /**
     * @param id            远程接口入参
     * @param authorization 远程接口需要的请求头信息
     * @return Result 是远程接口返回的对象
     */
    @GET("api/finance/selectById")
    Call<Result> getFinanceById(@Query("id") Long id, @Header("Authorization") String authorization);


}
